package org.jeecg.modules.quartz.job;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import io.finer.erp.jeecg.bas.entity.ZrkOrderProduct;
import io.finer.erp.jeecg.bas.entity.ZrkShoporder;
import io.finer.erp.jeecg.bas.service.IZrkOrderProcessService;
import io.finer.erp.jeecg.bas.service.IZrkOrderProductService;
import io.finer.erp.jeecg.bas.service.IZrkShoporderService;
import io.finer.erp.jeecg.bas.service.IZzShoporderService;

/**
 * 
* @ClassName: MallOrderJob 
* @Description: 定时器监控商城推送的订单，扫描到数据后对应生成任务工单 ----弃用改为手动分配工单
* @author heckerstone heckerstone@163.com
* @date Sep 3, 2020 1:56:15 PM 
*
 */
public class MallOrderJob implements Job {
	
	@Autowired
	private IZrkShoporderService zrkShoporderService;
	
	@Autowired
	private IZrkOrderProductService zrkOrderProductService;
	
	@Autowired
	private IZzShoporderService zzShoporderService;
	
	@Autowired
	private IZrkOrderProcessService zrkOrderProcessService;

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		//查询商城推送到销售订单的数据
		Map<String,Object> columnMap=new HashMap<String,Object>();
		columnMap.put("is_push", "0");
        Collection<ZrkShoporder> collection=zrkShoporderService.listByMap(columnMap);
        if(null!=collection&&collection.size()>0) {
        	Iterator<ZrkShoporder> iterator=collection.iterator();
        	while(iterator.hasNext()) {
        		ZrkShoporder zrkShoporder=iterator.next();
        		//查询商品明细
        		Map<String,Object> coluMap=new HashMap<String,Object>();
        		coluMap.put("shop_order", zrkShoporder.getShopOrder());
        		Collection<ZrkOrderProduct> zopCol=zrkOrderProductService.listByMap(coluMap);
        		//遍历商品明细生成工序
        		
        	}
        }
	}

}
